#ifndef	SPRING_H
#define SPRING_H

namespace Engine
{
	class Particle;

	class Spring
	{
		private:
			float m_naturalLength;
			float m_kValue;
			float m_minDist;
			float m_maxDist;

			Particle* m_a;
			Particle* m_b;

		public:
			Spring():m_naturalLength(0.0f), m_kValue(0.0f), m_minDist(0.0f), 
			m_maxDist(0.0f), m_a(nullptr), m_b(nullptr){}	

			Spring(float naturalLength, float kVal, float minDist, float maxDist, Particle* a, Particle* b):
			m_naturalLength(naturalLength), m_kValue(kVal), m_minDist(0.0f), m_maxDist(0.0f), m_a(a), m_b(b){}

			//gettters & setters
			void Set(float naturalLength, float kVal, float minDist, float maxDist, Particle* a, Particle* b);
			void SetNaturalLength(float n) {m_naturalLength = n;}
			void SetKValue(float k) {m_kValue = k;}
			void SetMinDist(float d) {m_minDist = d;}
			void SetMaxDist(float d) {m_maxDist = d;}
			void SetParticleA(Particle* a) {m_a = a;}
			void SetParticleB(Particle* b) {m_b = b;}

			float GetNaturalLength() const {return m_naturalLength;}
			float GetKValue() const {return m_kValue;}
			float GetMinDist() const {return m_minDist;}
			float GetMaxDist() const {return m_maxDist;}
			Particle* GetParticleA() {return m_a;}
			Particle* GetParticleB() {return m_b;}

			void Update();
			void Draw();
	};
};

#endif